package com.sen.common.widget.table;

import com.sen.common.widget.Attributes;
import com.sen.common.widget.Component;
import com.sen.common.widget.form.Content;

/**
 * @author sen
 */
public class TableTh extends Component {

	private String colspan;
	
	public TableTh() {
		this(null);
	}

	public TableTh(String id) {
		super("th");
		this.id(id);
	}
	
	public TableTh content(String content) {
		this.add(new Content(content));
		return this;
	}
	
	public TableTh colspan(int colspan) {
		this.colspan = String.valueOf(colspan);
		return this;
	}

	@Override
	protected String specialAttributes() {
		return Attributes.attrIfNonblank("colspan", colspan);
	}
}
